#include "stdafx.h"
#include "gameobject.h"
#include "Factory.h"


DWORD CGameObject::Distance()const
{
    CPlayer* pPlayer = IFactory::getSingleton().GetPlayer();
    if (!pPlayer) return 10;
    DWORD dw = (DWORD)CalcDistance3D(pPlayer->GetPos(), GetPos());
    return dw;
}

bool CGameObject::SortByDis(CGameObject& A, CGameObject& B)
{
    return A.Distance()<B.Distance();
}